From: Colin Walters Date: Wed, 22 Jul 2009 22:57:33 +0000 (-0400) Subject: Bug 589437 - Switch to workspace of target app to activate X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11193 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2cc650e38935d8af8e584e6430bfdd738a3701ca;p=gnome-shell.git Bug 589437 - Switch to workspace of target app to activate The user explicitly selected a window, so take them to it. --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index adc94cf02..2eaf51b4e 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -519,8 +519,17 @@ WellDisplayItem.prototype = { if (this._windows.length == 0) this.launch(); else { + /* Pick the first window and activate it, switching to its workspace + * if necessary. In the future, we want to have a menu dropdown here. */ let first = this._windows[0]; - first.activate(Clutter.get_current_event_time()); + let firstWorkspace = first.get_workspace(); + let currentWorkspaceIndex = Shell.Global.get().screen.get_active_workspace_index(); + let currentWorkspace = Shell.Global.get().screen.get_workspace_by_index(currentWorkspaceIndex); + let ts = Clutter.get_current_event_time(); + if (currentWorkspace != firstWorkspace) + firstWorkspace.activate_with_focus(first, ts); + else + first.activate(ts); } this.emit('activated'); },